import java.util.HashSet;
import java.util.Set;

/**
 * @ClassName LC575
 * @Author ykx
 * @Date 2024/7/6 18:18
 * @Version 1.0
 */
public class LC575 {
    public static void main(String[] args) {

    }

    public int distributeCandies(int[] candyType) {
        Set<Integer> set = new HashSet<>();
        for (int value : candyType) {
            set.add(value);
        }
        return Math.min(set.size(), candyType.length / 2);
    }

}
